package org.fizz.viper;

import java.net.Authenticator;
import java.net.PasswordAuthentication;

/**
 * 代理认证器
 * @author FIZZ
 * @version viper-1.0, 2014-4-17
 * @since 1.0
 */
public class ViperProxyAuthen extends Authenticator {

	/**
	 * 认证代理服务器的用户名
	 * @since 1.0
	 */
	private String username;
	/**
	 * 认证代理服务器的密码
	 * @since 1.0
	 */
	private String password;
	
	/**
	 * 构造一个代理认证器
	 * @param username 用户名
	 * @param password 密码
	 * @since 1.0
	 */
	public ViperProxyAuthen(String username, String password){
		this.username = username;
		this.password = password;
	}
	
	
	@Override
	protected PasswordAuthentication getPasswordAuthentication() {
		return new PasswordAuthentication(username, password.toCharArray());
	}
}
